home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / compile.c < prev    next >
C/C++ Source or Header  |  1996-01-30  |  16KB  |  581 lines

  1. /*
  2.     GWAda Development Environment for 386/486 PCs   
  3.     Copyright (C) 1993, Arthur Vargas Lopes  & Michael Bliss Feldman
  4.                         vlopes@vortex.ufrgs.br mfeldman@seas.gwu.edu
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; version 2 of the License.    
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19.  
  20. /*  Compile.c  */
  21.  
  22. #include <externs.h>
  23.  
  24. extern void AVL_MAKE_UNIT_DATE(AVL_EDIT_WINDOW_PTR w);
  25.  
  26. char *AVL_RUN_SELECT(AVL_UNITDT_PTR w)
  27. {
  28.     AVL_WIN_PTR temp = NULL, temp2 = NULL;
  29.     short rows, cols;
  30.     int i, j, k, n = 0, nc = 0;
  31.  
  32.     char msg[50];
  33.     char *ru;
  34.  
  35.     static AVL_BIND_SIZE r[50];
  36.     AVL_BIND_SIZE c[50];
  37.      
  38.     /* Pick obsolete units for compilation */
  39.     for(i = 0; i < w -> ns && n < 50; ++i)  
  40.         if (w -> s[i].status == 'A' && w -> s[i].is_main == ' ' &&
  41.             w -> s[i].fu[0] == 'b')   {
  42.             AVL_MAKE_BNAME(w -> s[i].fu, msg);
  43.             ru = msg;
  44.             j = strlen(ru);
  45.             if (j > 10 ) {
  46.                 j = j - 10;
  47.                 if (!strcmp("_idle_task",ru+j))  
  48.                     *(ru+j) = '\0';
  49.                 }
  50.             strcpy(r[n].name,msg);
  51.             ++n;
  52.             }                
  53.  
  54.     if (n > 0)
  55.         i = AVL_UNIT(r,n);
  56.     else {
  57.         i = -1;
  58.         AVL_ERROR("First compile any executable program unit.");
  59.         }
  60.     AVL_DEL_WINDOW(temp2);
  61.     if (i >= 0)
  62.         return r[i].name;
  63.     return NULL;
  64. }
  65.  
  66.  
  67. int AVL_EX_UNIT(char *name, char *opts[17])
  68. {
  69.     int cmd_ret_code, i;
  70.     char msg[100];
  71.     cmd_ret_code = spawnvp(P_WAIT,name,opts);
  72.     if (cmd_ret_code == -1)  {
  73.         switch( errno )  {
  74.             case E2BIG : sprintf(msg,"E2BIG"); break;
  75.             case EINVAL: strcpy(msg,"The mode argument is invalid."); break;
  76.             case ENOENT: sprintf(msg,"File or path name not found: %s",name); break;
  77.             case ENOEXEC : sprintf(msg,
  78. "The specified file is not an executable or has an inv. exec-file format: '%s'",name); break;
  79.             case ENOMEM : strcpy(msg,
  80. "Not enough memory is available to execute the child process."); break;
  81.             default : sprintf(msg,"errno = %d, could not know...", errno); break;
  82.             }
  83.         AVL_ERROR(msg);
  84.         return 0;
  85.         }
  86.     return 1;
  87. }
  88.  
  89.  
  90.  
  91. int AVL_COMP_SETUP(AVL_EDIT_WINDOW_PTR w)
  92. {
  93.     AVL_WIN_PTR temp;
  94.     FILE *fp, *fopen();
  95.     struct find_t c_file;
  96.  
  97.     char lookat[AVL_MAX_FILE_NAME+1];
  98.     short i;
  99.     char msg[AVL_MAX_FILE_NAME+100];
  100.     unsigned att;
  101.  
  102.     sprintf(lookat,"%s",avl_dir_library);
  103.     i = _dos_findfirst( lookat, _A_SUBDIR, &c_file );
  104.     if (!i)  {
  105.         i = _dos_getfileattr(lookat,&att);
  106.         if (att != _A_SUBDIR)  {
  107.             sprintf(msg," Library %s does not exist! ",avl_dir_library);
  108.             msg[77] = '\0';
  109.             temp = AVL_MAKE_WINDOW(msg,5,9,12,71,avl_wnd_bk_color,avl_wnd_color);
  110.             _outtext(" Your current directory contains a file that has the same\n");
  111.             _outtext(" name of the current library. Before creating a new library\n");
  112.             _outtext(" (Alt-O N) either change this file name or change the\n");
  113.             _outtext(" current library name (Alt-O D).\n\n");
  114.             _outtext("Press any key to continue...");
  115.             i = getch();
  116.             if (i == 0) i = getch();
  117.             AVL_DEL_WINDOW(temp);
  118.             return 1;
  119.             }
  120.         sprintf(msg,"%s\\LIB",avl_dir_library);
  121.         fp = fopen(msg,"r");
  122.         if (fp == NULL) {
  123.             sprintf(msg," Library %s has been corrupted! ",avl_dir_library);
  124.             msg[77] = '\0';
  125.             temp = AVL_MAKE_WINDOW(msg,5,9,11,71,avl_wnd_bk_color,avl_wnd_color);
  126.             _outtext(" Your current library has been corrupted. It is suggested\n");
  127.             _outtext(" a new library, that is, create a new library by pressing\n");
  128.             _outtext(" the Alt-O N keys.\n\n");
  129.             _outtext("Press any key to continue...");
  130.             i = getch();
  131.             if (i == 0) i = getch();
  132.             AVL_DEL_WINDOW(temp);
  133.             return 1;
  134.             }
  135.         }
  136.         
  137.     if (i)  {
  138.         sprintf(msg," Library %s does not exist! ",avl_dir_library);
  139.         msg[77] = '\0';
  140.         temp = AVL_MAKE_WINDOW(msg,5,9,11,71,avl_wnd_bk_color,avl_wnd_color);
  141.         _outtext(" A library must be created before compiling any program.\n");
  142.         _outtext(" Pressing the Alt-O N keys will create a library for you.\n");
  143.         _outtext(" To change the current library press the Alt-O D keys.\n\n");
  144.         _outtext("Press any key to continue...");
  145.         i = getch();
  146.         if (i == 0) i = getch();
  147.         AVL_DEL_WINDOW(temp);
  148.         return 1;
  149.         }
  150.  
  151.     avl_blank_line[0] = '\0';
  152.     w -> fix = AVL_FIX;
  153.     w -> options = AVL_READ_OPTIONS;
  154.     w -> delete = AVL_DEL_WINDOW;
  155.     w -> error = AVL_ERROR;
  156.     w -> line_no = 0;
  157.     w -> no_errors = 0;
  158.     w -> avl_win1 = NULL;
  159.     if (w -> changed)
  160.         AVL_SAVE();
  161.     w -> changed = '\0';
  162.     return 0;
  163. }
  164.  
  165. int AVL_DO_COMPILATION(char *s, int pause)
  166. {
  167.     AVL_EDIT_WINDOW_PTR w;
  168.     int lex, syntax, semantic, bind, gen, nopt = 0, n, i;
  169.     FILE *fp, *fopen();
  170.     AVL_WIN_PTR temp;
  171.     char msg[100];
  172.     char *opts[17];
  173.     char compiling[121];
  174.     avl_w = w = &avl_windows[avl_window];
  175.     fp = fopen("COMPILE.CK$","w");
  176.     fclose(fp);
  177.     temp = AVL_MAKE_WINDOW(" N.Y.U. Ada Compiler "
  178.         ,5,1,8,80,avl_wnd_bk_color,avl_wnd_color);
  179.  
  180.     sprintf(compiling," Compiling %s, please wait ...\n", s);
  181.     _outtext(compiling);
  182.     opts[nopt++] = "Adacomp";
  183.     opts[nopt++] = "-a";
  184.     opts[nopt++] = "-s";
  185.     opts[nopt++] = "-l";
  186.     opts[nopt++] = avl_dir_library;
  187.     sprintf(msg,"%s",s);
  188.     opts[nopt++] = msg;
  189.     opts[nopt++] = NULL;
  190.     unlink("gwada.smm");
  191.     if (AVL_EX_UNIT("ADACOMP", opts))  ;
  192.     AVL_DEL_WINDOW(temp);
  193.     avl_open_error_file = 0;
  194.     fp = fopen("GWADA.SMM","r");
  195.     if (fp == NULL)  
  196.         w -> no_errors = 0;
  197.     else {
  198.         fscanf(fp, "%d", &w -> no_errors);
  199.         fscanf(fp, "%d", &lex);
  200.         fscanf(fp, "%d", &syntax);
  201.         fscanf(fp, "%d", &semantic);
  202.         fscanf(fp, "%d", &bind);
  203.         fscanf(fp, "%d", &gen);
  204.         fclose(fp);
  205.         }
  206.  
  207.     if (w -> no_errors > 0)  {
  208.         n = 0;
  209.         if (lex) ++n;
  210.         if (syntax) ++n;
  211.         if (semantic) ++n;
  212.         if (bind) ++n;
  213.         if (gen) ++n;
  214.         temp = AVL_MAKE_WINDOW(" N.Y.U. Ada Compiler - Error Summary "
  215.             ,5,1,7+n,80,avl_wnd_bk_color,avl_wnd_color);
  216.         _settextposition(1,2);
  217.         sprintf(msg,"  %d error%s detected:", w -> no_errors, (w -> no_errors == 1) ? "" : "s");
  218.         _outtext(msg); 
  219.         n = 0;
  220.         _settextposition(2,2);
  221.         if (lex > 0) { 
  222.             ++n;
  223.             sprintf(msg,"        %d lexical error%s. ", lex, (lex == 1) ? "" : "s");
  224.             _outtext(msg); 
  225.             }
  226.         if (syntax > 0) { 
  227.             _settextposition(2+n++,2);
  228.             sprintf(msg,"        %d syntactical error%s. ", syntax, (syntax == 1) ? "" : "s");
  229.             _outtext(msg); 
  230.             }
  231.         if (semantic > 0) { 
  232.             _settextposition(2+n++,2);
  233.             sprintf(msg,"        %d semantical error%s. ", semantic, (semantic == 1) ? "" : "s");
  234.             _outtext(msg); 
  235.             }
  236.         if (bind > 0) { 
  237.             _settextposition(2+n++,2);
  238.             sprintf(msg,"        %d binding error%s. ", bind, (bind == 1) ? "" : "s");
  239.             _outtext(msg); 
  240.             }
  241.         if (gen > 0) { 
  242.             _settextposition(2+n++,2);
  243.             sprintf(msg,"        %d code generating error%s. ", gen, (gen == 1) ? "" : "s");
  244.             _outtext(msg); 
  245.             }
  246.         if (pause) {
  247.              i = getch(); if (i == 0) i = getch();
  248.              }
  249.         AVL_DEL_WINDOW(temp);
  250.         avl_open_error_file = 1;
  251.         lex = 1;
  252.         }
  253.     else  {
  254.         temp = AVL_MAKE_WINDOW(" N.Y.U. Ada Compiler ",5,1,9,80,avl_wnd_bk_color,avl_wnd_color);
  255.         _settextposition(1,2);
  256.         fp = fopen("COMPILE.CK$","r");
  257.         if (fp != NULL)  {
  258.             sprintf(msg," Compilation failed! Check installation. ");
  259.             fclose(fp);
  260.             lex = 1;
  261.             }
  262.         else {
  263.             sprintf(msg," Program %s compiled with success.\n\n  Press any key to continue...", s);
  264.              lex = 0;
  265.              }
  266.         _outtext(msg);
  267.         if (pause) {
  268.              i = getch(); if (i == 0) i = getch();
  269.              }
  270.         AVL_DEL_WINDOW(temp);
  271.         }
  272.     return lex;
  273. }                    
  274.  
  275.  
  276.  
  277. void AVL_COMPILE_CURRENT()
  278. {
  279.     AVL_EDIT_WINDOW_PTR w;
  280.     avl_w = w = &avl_windows[avl_window];
  281.     if (AVL_COMP_SETUP(w)) return;
  282.     strcpy(current_file_name,w -> file_name);
  283.     if (AVL_DO_COMPILATION(w -> file_name,1));
  284. }
  285.  
  286.  
  287. /*
  288. void AVL_COMP_ORDER()
  289. {
  290.     AVL_EDIT_WINDOW_PTR w;
  291.     AVL_WIN_PTR temp;
  292.     AVL_WIN_PTR m1, m2;
  293.     char *opts[19];
  294.     int nopt = 0;
  295.     char msg[100];
  296.     char s[121];
  297.     char s2[121];
  298.     char search_space[10][128];
  299.     static char *msgc = "GWAda - Consider which set of files? ";
  300.     int i, j, n, n1, n2;
  301.     int no_units, larger;
  302.     static int first = 0;
  303.     static char lastfn[121];
  304.     static char fname[121];
  305.     char compiling[121];
  306.     FILE *fp2, *fopen();
  307.     avl_w = w = &avl_windows[avl_window];
  308.     n1 = 62;
  309.     n2 = (80 - n1) / 2;
  310.     m1 = AVL_MAKE_WINDOW(msgc,7,n2,9,n1+n2,avl_wnd_bk_color,avl_wnd_color);
  311.     if (first == 0)
  312.         sprintf(lastfn,"%s%c*.ada",avl_dir_sources,92);
  313.     first = 1;
  314.     strcpy(fname,lastfn);
  315.  
  316.     if (AVL_PROMPT(1,1,fname,60))  {
  317.         AVL_DEL_WINDOW(m1);
  318.         return;
  319.         }
  320.  
  321.     strcpy(lastfn,fname);
  322.     for(i = 0, j = 0, n = 0; i < strlen(fname); ++i)  
  323.         if (isspace(fname[i])) {
  324.             search_space[n++][j] = '\0';
  325.             j = 0;
  326.             while(isspace(fname[i])) ++i;
  327.             --i;
  328.             }
  329.         else
  330.             search_space[n][j++] = fname[i];
  331.     search_space[n++][j] = '\0';
  332.     AVL_DEL_WINDOW(m1);
  333.     temp = AVL_MAKE_WINDOW(" GWAda Bottom Up Parts Compiler "
  334.         ,2,1,9,80,avl_wnd_bk_color,avl_wnd_color);
  335.  
  336.     sprintf(compiling," Building compilation order for %s\n Please wait ...\n"
  337.         , w -> file_name );
  338.     _outtext(compiling);
  339.     opts[nopt++] = "GWADACO";
  340.     opts[nopt++] = avl_dir_library;
  341.     opts[nopt++] = w -> file_name;
  342.     for(i = 0; i < n; ++i)
  343.         opts[nopt++] = search_space[i];
  344.     opts[nopt++] = NULL;
  345.     if (AVL_EX_UNIT("GWADACO", opts))  ;
  346.     fp2 = fopen("AVLCOMPO.DAT","r");
  347.     if (fp2 == NULL) {
  348.         AVL_ERROR("Request failed! Check installation or set of files");
  349.         AVL_DEL_WINDOW(temp);
  350.         return;
  351.         }
  352.     AVL_DEL_WINDOW(temp);
  353.     j = 0;
  354.     fscanf(fp2,"%d %d", &no_units, &larger);
  355.     sprintf(compiling," Units Compiled ");
  356.     if (larger < strlen(compiling)) larger = strlen(compiling);
  357.     larger += 2;
  358.     if (larger > 74) larger = 74;
  359.     if (no_units > 18) no_units = 18;
  360.     i = (76 - larger);
  361.     n = 23 - no_units;
  362.     m2 = AVL_MAKE_WINDOW(compiling,n,i,n+no_units+1,i+larger+2,avl_txt_bk_color,avl_txt_color);
  363.     while ( fscanf(fp2,"%s",s2) != EOF) {
  364.         sprintf(s, "%s",s2);
  365.         sprintf(compiling,"\n %s",s);
  366.         strcpy(current_file_name,s);
  367.  
  368.         if (AVL_COMP_SETUP(w)) {
  369.             fclose(fp2);
  370.             AVL_DEL_WINDOW(m2);
  371.             return;
  372.             }
  373.             
  374.         if (AVL_DO_COMPILATION(s,0)) {
  375.             fclose(fp2);
  376.             AVL_DEL_WINDOW(m2);
  377.             return;
  378.             }
  379.         _outtext(compiling);
  380.         ++j;
  381.         }                    
  382.     if (j == 0)
  383.         AVL_ERROR("There is nothing to compile");
  384.     else {
  385.         temp = AVL_MAKE_WINDOW(" N.Y.U. Ada Compiler ",5,1,9,80,avl_wnd_bk_color,avl_wnd_color);
  386.         _settextposition(1,2);
  387.         sprintf(msg," %d unit%s compiled with success.\n\n  Press any key to continue..."
  388.             , j, (j > 1) ? "s" : "" );
  389.         _outtext(msg);
  390.         i = getch(); if (i == 0) i = getch();
  391.         AVL_DEL_WINDOW(temp);
  392.         }
  393.     AVL_DEL_WINDOW(m2);
  394.     fclose(fp2);
  395. }
  396.     
  397. */
  398.  
  399. void AVL_COMPILE()
  400. {
  401.     AVL_EDIT_WINDOW_PTR w;
  402.     char msg[100];
  403.     char s[121];
  404.     static char *msgc = "GWAda - Compile which file? ";
  405.     char *opts[17];
  406.     int nopt = 0;
  407.     int i, n, n1, n2;
  408.     AVL_WIN_PTR m1;
  409.     AVL_SOURCE_SIZE t;
  410.     static int first = 0;
  411.     static char lastfn[121];
  412.     char fname[121];
  413.     avl_w = w = &avl_windows[avl_window];
  414.     n1 = 62;
  415.     n2 = (80 - n1) / 2;
  416.     m1 = AVL_MAKE_WINDOW(msgc,7,n2,9,n1+n2,avl_wnd_bk_color,avl_wnd_color);
  417.     if (first == 0)
  418.         sprintf(lastfn,"%s%c*.ada",avl_dir_sources,92);
  419.     first = 1;
  420.     strcpy(fname,lastfn);
  421.     if (AVL_PROMPT(1,1,fname,60))  {
  422.         AVL_DEL_WINDOW(m1);
  423.         return;
  424.         }
  425.     strcpy(lastfn,fname);
  426.     AVL_GET_FILE_NAMES(&t,fname);
  427.     AVL_DEL_WINDOW(m1);
  428.     if (t.no_files == 0)  {
  429.         sprintf(s,"Can't find any file under \'%s\'",fname);
  430.         AVL_ERROR(s);
  431.         return;
  432.         }
  433.     s[0] = '\0';
  434.     if ((n = AVL_SOURCES(&t,t.no_files,fname)) < 0) return;
  435.     for(i = strlen(fname) - 1; t.no_files > 0 && i > 0; --i)  {
  436.         if (fname[i] == 92 && i > 0) {
  437.             fname[i+1] = '\0';
  438.             i  = -10;
  439.             break;
  440.             }
  441.         }
  442.     if (i < -1)
  443.         sprintf(s,"%s%s",fname,t.name[n]);
  444.     else
  445.         sprintf(s, "%s",t.name[n]);
  446.     if (s[0] == '\0')
  447.         return;
  448.     strcpy(current_file_name,s);
  449.     if (AVL_COMP_SETUP(w)) return;
  450.     AVL_DO_COMPILATION(s,1);
  451. }
  452.  
  453. void AVL_NEW_LIB()
  454. {
  455.     AVL_EDIT_WINDOW_PTR w;
  456.     AVL_WIN_PTR temp;
  457.     char msg[100];
  458.     char *opts[17];
  459.     int cmd_ret_code, i;
  460.     FILE *fp, *fopen();
  461.     w = &avl_windows[avl_window];
  462.     fp = fopen("DUMMY.ADA","w");
  463.     if (fp == NULL) {
  464.         AVL_ERROR("Can't create new library! Check disk space...");
  465.         return;
  466.         }
  467.     fprintf(fp," PROCEDURE DUMMY IS BEGIN NULL; END DUMMY; ");
  468.     fclose(fp);
  469.     w -> no_errors = 0;
  470.     sprintf(msg,"%s\\LIB",avl_dir_library);
  471.     fp = fopen(msg,"r");
  472.     if (fp == NULL) {
  473.         rmdir(avl_dir_library);
  474.         if (mkdir(avl_dir_library)) {
  475.             sprintf(msg,"Unable to create library '%s'",avl_dir_library);
  476.             AVL_ERROR(msg);
  477.             return;
  478.             }
  479.         }
  480.     else
  481.         fclose(fp);
  482.     temp = AVL_MAKE_WINDOW(" N.Y.U. Ada Compiler "
  483.         ,5,1,8,80,avl_wnd_bk_color,avl_wnd_color);
  484.     _outtext("Creating new library, please wait...\n");
  485.     opts[0] = "AdaComp";
  486.     opts[1] = "-n"; 
  487.     opts[2] = "-l";
  488.     opts[3] = avl_dir_library;
  489.     opts[4] = "dummy.ada";
  490.     opts[5] = NULL;
  491.     unlink("gwada.smm");
  492.     if (AVL_EX_UNIT("ADACOMP", opts))  ;
  493.     avl_open_error_file = 0;
  494.     fp = fopen("GWADA.SMM","r");
  495.     if (fp == NULL)  
  496.         w -> no_errors = 0;
  497.     else {
  498.         fscanf(fp, "%d", &w -> no_errors);
  499.         fclose(fp);
  500.         }
  501.     if (w -> no_errors > 0)  
  502.         AVL_ERROR("Library was not created properly!");
  503.     unlink("dummy.ada");
  504.     AVL_DEL_WINDOW(temp);
  505. }
  506.  
  507.  
  508. void AVL_RUN()
  509. {
  510.     AVL_UNITDT w;
  511.     AVL_EDIT_WINDOW_PTR ww;
  512.     AVL_WIN_PTR temp;
  513.     FILE *fp;
  514.     char msg[100];
  515.     char m2[4][12];
  516.     char t_opts[12];
  517.     short ncmd = 0;    
  518.     short ti = 0;
  519.     char *opts[19];
  520.     char *runit;
  521.     short nopt = 0;
  522.     short cmd_ret_code, i;
  523.     avl_blank_line[0] = '\0';
  524.     ww = &avl_windows[avl_window];
  525.     w.ns = 0;
  526.     opts[0] = "Adalib2";
  527.     opts[1] = "-l";
  528.     opts[2] = avl_dir_library;
  529.     opts[3] = NULL;
  530.     temp = AVL_MAKE_WINDOW(" Run ",5,1,9,80,avl_wnd_bk_color,avl_wnd_color);
  531.     _outtext("  Searching library. Please, wait a moment...\n");
  532.     if (AVL_EX_UNIT("ADALIB2", opts))  ;
  533.     AVL_DEL_WINDOW(temp);
  534.     AVL_MAKE_UNIT_DATE(&w);
  535.     if (w.ns == 0)  {
  536.         AVL_ERROR("First compile any executable program unit.");
  537.         return;
  538.         }
  539.  
  540.     runit = AVL_RUN_SELECT(&w);
  541.     if (runit == NULL)  
  542.         return;
  543.         temp = AVL_MAKE_WINDOW(" N. Y. U. Ada Interpreter "
  544.         ,11,1,14,80,avl_wnd_bk_color,avl_wnd_color);
  545.     _outtext("Loading interpreter, please wait...");
  546.     _settextposition(2,2);
  547.     if (avl_trace_opts[0]) t_opts[ti++] = 'a';
  548.     if (avl_trace_opts[1]) t_opts[ti++] = 'c';
  549.     if (avl_trace_opts[2]) t_opts[ti++] = 'e';
  550.     if (avl_trace_opts[3]) t_opts[ti++] = 'r';
  551.     if (avl_trace_opts[4]) t_opts[ti++] = 's';
  552.     if (avl_trace_opts[5]) t_opts[ti++] = 't';
  553.     if (ti) t_opts[ti] = '\0';
  554.  
  555.     opts[nopt++] = (avl_monitor_on) ? "gwumon" : "adaexec";
  556.     opts[nopt++] = "-m";
  557.     opts[nopt++] = runit;
  558.     if (!avl_monitor_on)  {
  559.         if (avl_heap) {sprintf(m2[0],"%d",avl_heap); opts[nopt++]="-h"; opts[nopt++]=m2[0];}
  560.         if (avl_pgm_stack) {sprintf(m2[1],"%d",avl_pgm_stack); opts[nopt++]="-p"; opts[nopt++]=m2[1];}
  561.         if (avl_task_stack) {sprintf(m2[2],"%d",avl_task_stack); opts[nopt++]="-s"; opts[nopt++]=m2[2];}
  562.         }
  563.     if (avl_scheduller) {sprintf(m2[3],"%d",avl_scheduller); opts[nopt++]="-r"; opts[nopt++]=m2[3];}
  564.     if (!avl_monitor_on)  
  565.         if (ti) {
  566.             opts[nopt++] = "-t";
  567.             opts[nopt++] = t_opts;
  568.             }
  569.     opts[nopt++] = avl_dir_library;
  570.     opts[nopt++] = NULL;
  571.     _setvideomode( _DEFAULTMODE );
  572.     _settextrows( 25 );
  573.     _clearscreen( _GCLEARSCREEN );
  574.     if (AVL_EX_UNIT((avl_monitor_on) ? "GWUMON" : "ADAEXEC", opts))  {
  575.         printf("\n\nPress any key to return to GWAda ...");
  576.         i = getch(); if (i == 0) i = getch();
  577.         }
  578.     AVL_DEL_WINDOW(temp);
  579. }
  580.  
  581.